package com.knight.mall.service.impl;

import java.util.List;

import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.knight.mall.mappers.LogisticsCompanyMapper;
import com.knight.mall.model.LogisticsCompany;
import com.knight.mall.query.LogisticsCompanyQuery;
import com.knight.mall.service.LogisticsCompanyService;

/**
 * 物流公司服务类实现
 * 
 * @author <a href="mailto:xbd0723@163.com">LiXuan</a> 2016年9月23日上午9:08:43
 */
@Service("logisticsCompanyService")
public class LogisticsCompanyServiceImpl implements LogisticsCompanyService {
	private static final Logger logger = LoggerFactory.getLogger(LogisticsCompanyServiceImpl.class);
	@Autowired
	LogisticsCompanyMapper logisticsCompanyMapper;

	@Override
	public Long add(LogisticsCompany logisticsCompany) {
		logisticsCompanyMapper.insert(logisticsCompany);
		return logisticsCompany.getId();

	}

	@Override
	public void update(LogisticsCompany logisticsCompany) {
		logisticsCompanyMapper.update(logisticsCompany);
	}

	@Override
	public List<LogisticsCompany> queryList(LogisticsCompanyQuery query) {
		return logisticsCompanyMapper.queryList(query);
	}

	@Override
	public int queryCount(LogisticsCompanyQuery query) {
		return logisticsCompanyMapper.queryCount(query);
	}

	@Override
	public LogisticsCompany load(Long id) {
		LogisticsCompany logisticsCompany = logisticsCompanyMapper.load(id);
		return logisticsCompany;
	}

	@Override
	public List<LogisticsCompany> getAllList() {
		LogisticsCompanyQuery query = new LogisticsCompanyQuery();
		query.setStatus(1);
		List<LogisticsCompany> list = logisticsCompanyMapper.queryList(query);
		return list;
	}
}
